

#include <sudoku.h>
#include <matrix.h>

#include <stdlib.h>
#include <time.h>

sdk_list *_sdk_new_full_list();
void      _sdk_clear_sub_mtx(sudoku *, int, int);

int _sdk_generate_sub_mtx(sudoku *sdk, int brow, int bcol){

  return 0;

}

void _sdk_do_generate_sudoku(sudoku *sdk){

  _sdk_clean_sudoku(sdk);
  unsigned int seed = time(NULL);
#ifdef _DEBUG
  fprintf(stderr, "Using seed: %d\n", seed);
#endif
  srand(seed);


}

sudoku *sdk_generate_sudoku(){

  sudoku *sdk = SDK_SUDOKU_ALLOC();
  _sdk_do_generate_sudoku(sdk);
  return sdk;

}

void _sdk_clear_sub_mtx(sudoku *sdk, int brow, int bcol){

  int i = brow * SDK_SUB_MTX_SIZE;
  int j = bcol * SDK_SUB_MTX_SIZE;

  for ( ; i < (brow + 1) * SDK_SUB_MTX_SIZE; i++){
    for ( ; j < (bcol + 1) * SDK_SUB_MTX_SIZE; j++){
      memset(&SDK_ELEM(sdk, i, j), 0, sizeof(sdk_square));
    }
  }

}
